package cn.lyjuan.archetypes.bms.web.util;


import cn.lyjuan.archetypes.bms.web.exception.BmsException;

public class ErrUtils
{
    /**
     * 业务异常
     * @param code
     * @param msg
     * @param log
     */
    public static void appThrow(Integer code, String msg, String log, Throwable throwable)
    {
        throw new BmsException(code, msg, log, throwable);
    }

    /**
     * 业务异常
     * @param code
     */
    public static void appThrow(Integer code)
    {
        appThrow(code, null, null, null);
    }

    public static void appThrow(String msg, String log)
    {
        appThrow(null, msg, log, null);
    }

    public static void appThrow(String msg)
    {
        appThrow(null, msg, msg, null);
    }

    /**
     * 业务异常
     * @param code
     * @param msg
     */
    public static void appThrow(Integer code, String msg)
    {
        appThrow(code, msg, null, null);
    }

    public static void appThrow(Integer code, String msg, String log)
    {
        appThrow(code, msg, log, null);
    }

    public static void appThrow(Integer code, String msg, Throwable throwable)
    {
        appThrow(code, msg, null, throwable);
    }

    public static void appThrow(Integer code, Throwable throwable)
    {
        appThrow(code, null, null, throwable);
    }

    public static void appThrow(Throwable throwable)
    {
        appThrow(null, null, null, throwable);
    }
}
